import Vue from 'vue';
import App from './App.vue';
import axios from 'axios';
import router from './router/index';
import setupRouterGuards from './router/guards';
import store from './store/index';
import './styles/global.css';
import i18n from './lang/index';

Vue.config.productionTip = false;
Vue.prototype.$http = axios;

// 在Vue原型上添加store，方便组件访问
Vue.prototype.$store = store;

// 应用路由守卫
setupRouterGuards(router);

// 初始化应用状态
store.actions.initApp(store);

new Vue({
  router,
  i18n,
  render: h => h(App),
}).$mount('#app');